<%@page import="com.itheima.bean.Product"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		List<Product> list = (List<Product>)request.getAttribute("list");
	%>

	<table border="1px" align="left">
		<tr>
			<th>商品id</th>
			<th>商品名称</th>
			<th>商品价格</th>
			<th>商品描述</th>
		</tr>
		<%
			if(list==null){
				%>
				<tr>
					<td colspan="4">暂无商品</td>
				</tr>
				<%
			}else{
				for(Product pro:list){
					%>
					<tr>
						<td><%=pro.getId() %></td>
						<td><%=pro.getPname() %></td>
						<td><%=pro.getPrice() %></td>
						<td><%=pro.getPdesc() %></td>
					</tr>
					<%
				}
			}
		%>
	</table>
</body>
</html>